home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / amos / amsls396.lzh / AMOSLIST / 000074_jlubbers@fwi.uva.nl_Tue Mar 19 11:15:11 1996.msg < prev    next >
Internet Message Format  |  1996-04-01  |  3KB

  1. Received: from conan.eds-ms.com (conan.eds-ms.com [204.240.136.11]) by mail1.access.digex.net (8.6.12/8.6.12) with SMTP id LAA23198;  for <mcox@access.digex.net> ; Tue, 19 Mar 1996 11:15:09 -0500
  2. Received: from mail.fwi.uva.nl by conan.eds-ms.com (5.x/SMI-SVR4)
  3.     id AA27806; Tue, 19 Mar 1996 09:08:10 -0500
  4. Received: from ow59.fwi.uva.nl
  5.           by mail.fwi.uva.nl with ESMTP (sendmail 8.7.3/config 6.4).
  6.           id PAA15851; Tue, 19 Mar 1996 15:07:45 +0100 (MET)
  7. Received: from localhost
  8.           by ow59.fwi.uva.nl (sendmail 8.7.3/config 6.5).
  9.           id PAA02394; Tue, 19 Mar 1996 15:07:44 +0100 (MET)
  10. Message-Id: <199603191407.PAA02394@ow59.fwi.uva.nl>
  11. Date: Tue, 19 Mar 1996 15:07:44 +0100 (MET)
  12. From: jlubbers@fwi.uva.nl (Jan Lubbers)
  13. X-Organisation: Faculty of Mathematics, Computer Science, Physics & Astronomy
  14.                 University of Amsterdam
  15.                 Plantage Muidergracht 24
  16.                 NL-1018 TV Amsterdam
  17.                 The Netherlands
  18. X-Phone:        +31 20 525 5200
  19. X-Fax:          +31 20 525 5101
  20. To: amos-list@conan.eds-ms.com
  21. Subject: fine grained movement
  22. X-Sun-Charset: US-ASCII
  23. Status: RO
  24. X-Status: 
  25.  
  26. Hi all!
  27.  
  28. I do have a question, and I hope someone can help...
  29. For a game I'm programming, I have modeled the movement for a car as follows:
  30.  
  31. The car has variable speed, say 0-10
  32.  
  33. When I move the car north (0 degrees):
  34. I multiply the speed with 1 (angle-modifier).
  35.  
  36. When I move the car northeast (45 degrees):
  37. I multiply the speed with 0.5 * sqrt(2), obviously
  38.  
  39. For coordinates I use fixed-point maths.
  40. So I store in a table the calculated angle-modifiers (sine of angle)
  41. For readability I have used a factor of 1000 here instead of
  42. a large power of 2, which I actually use.
  43.  
  44. degrees  x_movement y_movement
  45.    0           0      -1000
  46.   45         707      - 707
  47.   90        1000          0
  48. etc.
  49.  
  50. Ok, what happens when my car moves at speed 1, direction northeast?
  51. Assume (startx,starty) = (100,000 , 100,000)
  52.  
  53. x: 100,000  100,707  101,414 102,121 102,828
  54. y: 100,000   99,293  98,586   97,879  97,172
  55.  
  56. On screen this would result in the folling coordinate list:
  57.  
  58. x: 100 100 101 102 102
  59. y: 100  99  98  97  97
  60.       
  61. dx:   0   1   0    1
  62. dy:  -1  -1  -1    0
  63.  
  64. Which of course causes a jerk in the movement and THAT is the biiiiiig
  65. PROBLEM. I don't want that jerk in my movement. :-(
  66.  
  67. However, after bumping my head to a wall for days (after having tried
  68. numerous other solutions, like moving 1 pixel every n frames, where a
  69. is a variable depending on the angle and the speed),
  70. I come to you for help! I'm desparate...
  71. When I look at a game like Super Cars 2 or Nitro, or All Terrain Racing
  72. I __never__ see the jerk movements in these games like in my own game.
  73.  
  74. Why-oh-Why?
  75.  
  76. Regards,
  77.  
  78. Yours desparately,
  79.  
  80. Jan Lubbers, student AI
  81.  
  82.  
  83.  
  84.  
  85.